
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>Hexo</title>
        <meta name="author" content="John Doe" />
        <meta name="description" content="" />
        <meta name="keywords" content="" />
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
        <link rel="icon" href="/images/avatar.jpg" />
        <script src="https://cdn.staticfile.org/vue/3.2.47/vue.global.prod.min.js"></script>
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.3.0/css/all.min.css" />
<link rel="stylesheet" href="/css/fonts.min.css" />
<script> const mixins = {}; </script>

<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>


<script src="https://cdn.staticfile.org/highlight.js/11.7.0/highlight.min.js"></script>
<link
    rel="stylesheet"
    href="https://cdn.staticfile.org/highlight.js/11.7.0/styles/github.min.css"
/>
<script src="/js/lib/highlight.js"></script>



<script src="/js/lib/preview.js"></script>









<link rel="stylesheet" href="/css/main.css" />

    <meta name="generator" content="Hexo 6.3.0"></head>
    <body>
        <div id="layout">
            <transition name="fade">
            <div id="loading" v-show="loading">
                <div id="loading-circle">
                    <h2>LOADING</h2>
                    <p>加载过慢请开启缓存&ensp;浏览器默认开启</p>
                    <img src="/images/loading.gif" />
                </div>
            </div>
            </transition>
            <transition name="into">
            <div id="main" v-show="!loading">
                <nav id="menu" ref="menu">
    <div class="desktop-menu">
        <a class="title" href="/">
            <span>HEXO</span>
        </a>
        
        <a href="/">
            <i class="fa-solid fa-house fa-fw"></i>
            <span>&ensp;Home</span>
        </a>
        
        <a href="/about">
            <i class="fa-solid fa-id-card fa-fw"></i>
            <span>&ensp;About</span>
        </a>
        
        <a href="/archives">
            <i class="fa-solid fa-box-archive fa-fw"></i>
            <span>&ensp;Archives</span>
        </a>
        
        <a href="/categories">
            <i class="fa-solid fa-bookmark fa-fw"></i>
            <span>&ensp;Categories</span>
        </a>
        
        <a href="/tags">
            <i class="fa-solid fa-tags fa-fw"></i>
            <span>&ensp;Tags</span>
        </a>
        
    </div>
    <div id="mobile-menu">
        <div class="curtain" v-show="showMenu" @click="showMenu = !showMenu"></div>
        <div class="title" @click="showMenu = !showMenu">
            <i class="fa-solid fa-bars fa-fw"></i>
            <span>&emsp;HEXO</span>
        </div>
        <transition name="slide">
        <div class="items" v-show="showMenu">
            
            <a href="/">
                <div class="item">
                    <div style="min-width: 20px; max-width: 50px; width: 10%">
                        <i class="fa-solid fa-house fa-fw"></i>
                    </div>
                    <div style="min-width: 100px; max-width: 150%; width: 20%">Home</div>
                </div>
            </a>
            
            <a href="/about">
                <div class="item">
                    <div style="min-width: 20px; max-width: 50px; width: 10%">
                        <i class="fa-solid fa-id-card fa-fw"></i>
                    </div>
                    <div style="min-width: 100px; max-width: 150%; width: 20%">About</div>
                </div>
            </a>
            
            <a href="/archives">
                <div class="item">
                    <div style="min-width: 20px; max-width: 50px; width: 10%">
                        <i class="fa-solid fa-box-archive fa-fw"></i>
                    </div>
                    <div style="min-width: 100px; max-width: 150%; width: 20%">Archives</div>
                </div>
            </a>
            
            <a href="/categories">
                <div class="item">
                    <div style="min-width: 20px; max-width: 50px; width: 10%">
                        <i class="fa-solid fa-bookmark fa-fw"></i>
                    </div>
                    <div style="min-width: 100px; max-width: 150%; width: 20%">Categories</div>
                </div>
            </a>
            
            <a href="/tags">
                <div class="item">
                    <div style="min-width: 20px; max-width: 50px; width: 10%">
                        <i class="fa-solid fa-tags fa-fw"></i>
                    </div>
                    <div style="min-width: 100px; max-width: 150%; width: 20%">Tags</div>
                </div>
            </a>
            
        </div>
        </transition>
    </div>
</nav>

                <div class="article">
    <div>
        <h1></h1>
    </div>
    <div class="info">
        <span class="date">
            <span class="icon">
                <i class="fa-solid fa-calendar fa-fw"></i>
            </span>
            2023/4/2
        </span>
        
        
    </div>
    
    <div class="content" v-pre>
        <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">/*</span><br><span class="line"> *                        _oo0oo_</span><br><span class="line"> *                       o8888888o</span><br><span class="line"> *                       88&quot; . &quot;88</span><br><span class="line"> *                       (| -_- |)</span><br><span class="line"> *                       0\  =  /0</span><br><span class="line"> *                     ___/`---&#x27;\___</span><br><span class="line"> *                   .&#x27; \\|     |// &#x27;.</span><br><span class="line"> *                  / \\|||  :  |||// \</span><br><span class="line"> *                 / _||||| -:- |||||- \</span><br><span class="line"> *                |   | \\\  - /// |   |</span><br><span class="line"> *                | \_|  &#x27;&#x27;\---/&#x27;&#x27;  |_/ |</span><br><span class="line"> *                \  .-\__  &#x27;-&#x27;  ___/-. /</span><br><span class="line"> *              ___&#x27;. .&#x27;  /--.--\  `. .&#x27;___</span><br><span class="line"> *           .&quot;&quot; &#x27;&lt;  `.___\_&lt;|&gt;_/___.&#x27; &gt;&#x27; &quot;&quot;.</span><br><span class="line"> *          | | :  `- \`.;`\ _ /`;.`/ - ` : | |</span><br><span class="line"> *          \  \ `_.   \_ __\ /__ _/   .-` /  /</span><br><span class="line"> *      =====`-.____`.___ \_____/___.-`___.-&#x27;=====</span><br><span class="line"> *                        `=---=&#x27;</span><br><span class="line"> *</span><br><span class="line"> *</span><br><span class="line"> *      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><br><span class="line"> *</span><br><span class="line"> *            佛祖保佑     永不宕机     永无BUG</span><br><span class="line"> */</span><br></pre></td></tr></table></figure>



<p>![image-20230326144918734](&#x2F;Users&#x2F;zsy&#x2F;Library&#x2F;Application Support&#x2F;typora-user-images&#x2F;image-20230326144918734.png)</p>
<h4 id="上线"><a href="#上线" class="headerlink" title="上线"></a>上线</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">1、链接(阿里配置安全端口)</span><br><span class="line">ssh root@ip</span><br><span class="line">2、启动服务</span><br><span class="line">yum install -y nginx</span><br><span class="line">nginx</span><br><span class="line">3、cat /etc/nginx/nginx.conf</span><br><span class="line"></span><br><span class="line">本地文件 远程拷贝</span><br><span class="line">scp -r ./dist/* root@139.196.233.124:/usr/share/nginx/html/</span><br><span class="line">4、解决跨域 （vi /etc/nginx/nginx.conf)</span><br><span class="line">   location / &#123;</span><br><span class="line">        try_files $uri $uri/ /index.html;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        location ^~ /prod-api &#123;</span><br><span class="line">        proxy_pass http://ihrm.itheima.net; # 代理解决跨域问题</span><br><span class="line">        &#125;</span><br><span class="line">5、 nginx -s reload （重启nginx）</span><br><span class="line"></span><br><span class="line">mysql:sudo /usr/local/mysql/support-files/mysql.server start</span><br><span class="line"></span><br></pre></td></tr></table></figure>





<h3 id="表单定义"><a href="#表单定义" class="headerlink" title="表单定义"></a>表单定义</h3><p>触发条件</p>
<p>事件源</p>
<p>事件类型</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;el-form :model=&quot;formData&quot; :rules=&quot;rules&quot; label-width=&quot;120px&quot;&gt;</span><br><span class="line">     &lt;el-form-item prop=&quot;name&quot; label=&quot;部门名称&quot;&gt;</span><br><span class="line">       &lt;el-input v-model=&quot;formData.name&quot; placeholder=&quot;1-50个字符&quot; style=&quot;width:80%&quot; /&gt;</span><br></pre></td></tr></table></figure>

<h3 id="封装接口"><a href="#封装接口" class="headerlink" title="封装接口"></a>封装接口</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">export</span> <span class="keyword">function</span> <span class="title function_">getUserDetailById</span>(<span class="params">id</span>) &#123;</span><br><span class="line">  <span class="keyword">return</span> <span class="title function_">request</span>(&#123;</span><br><span class="line">    <span class="attr">url</span>: <span class="string">`/sys/user/<span class="subst">$&#123;id&#125;</span>`</span></span><br><span class="line">  &#125;)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="sync"><a href="#sync" class="headerlink" title="sync"></a>sync</h3><p> <son :a.sync="name" :b.sync="num" >&lt;&#x2F;son&gt;</p>
<p>   this.$emit(‘update:a’, ‘大明同学’)      this.$emit(‘update:b’, 100)</p>
<h3 id="Provide-x2F-Inject-子获取父"><a href="#Provide-x2F-Inject-子获取父" class="headerlink" title="Provide&#x2F;Inject(子获取父)"></a>Provide&#x2F;Inject(子获取父)</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">应用层 Provide</span><br><span class="line">export default &#123;</span><br><span class="line">  data() &#123;</span><br><span class="line">    return &#123;</span><br><span class="line">      message: &#x27;hello!&#x27;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br><span class="line">  provide() &#123;</span><br><span class="line">    // 使用函数的形式，可以访问到 `this`</span><br><span class="line">    return &#123;</span><br><span class="line">      message: this.message</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">inject 注入</span><br><span class="line">export default &#123;</span><br><span class="line">  inject: [&#x27;message&#x27;],</span><br><span class="line">  created() &#123;</span><br><span class="line">    console.log(this.message) // injected value</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h3 id="注册自定义指令："><a href="#注册自定义指令：" class="headerlink" title="注册自定义指令："></a>注册自定义指令：</h3><p>创建一个文件：directive</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//updataErroImage 指令名</span></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">const</span> <span class="title class_">UpdataErroImage</span> = &#123;</span><br><span class="line">  <span class="title function_">inserted</span>(<span class="params">dom, options</span>) &#123;</span><br><span class="line">    dom.<span class="property">onerror</span> = <span class="function">() =&gt;</span> &#123;</span><br><span class="line">      dom.<span class="property">src</span> = options.<span class="property">value</span></span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">//// 自定义指令</span></span><br><span class="line"><span class="comment">// Vue.directive(&#x27;ikun&#x27;, &#123;</span></span><br><span class="line"><span class="comment">//   inserted(dom, options) &#123;</span></span><br><span class="line"><span class="comment">//     // console.log(&#x27;dom&#x27;, dom)</span></span><br><span class="line"><span class="comment">//     // console.log(&#x27;options&#x27;, options.value)</span></span><br><span class="line">成功后</span><br><span class="line"><span class="comment">//     dom.onload = () =&gt; &#123;</span></span><br><span class="line"><span class="comment">//       console.log(&#x27;wo jia zai &#x27;)</span></span><br><span class="line"><span class="comment">//     &#125;</span></span><br><span class="line">失败后</span><br><span class="line"><span class="comment">//     dom.onerror = () =&gt; &#123;</span></span><br><span class="line"><span class="comment">//       dom.src = options.value.src</span></span><br><span class="line"><span class="comment">//       console.log(&#x27;faile&#x27;)</span></span><br><span class="line"><span class="comment">//     &#125;</span></span><br><span class="line"><span class="comment">//   &#125;</span></span><br><span class="line"><span class="comment">// &#125;)</span></span><br></pre></td></tr></table></figure>

<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">main全局注册</span><br><span class="line"><span class="keyword">import</span> * <span class="keyword">as</span> directives <span class="keyword">from</span> <span class="string">&#x27;@/directives&#x27;</span></span><br><span class="line"><span class="title class_">Object</span>.<span class="title function_">keys</span>(directives).<span class="title function_">forEach</span>(<span class="function"><span class="params">key</span> =&gt;</span> &#123;</span><br><span class="line">  <span class="title class_">Vue</span>.<span class="title function_">directive</span>(key, directives[key])</span><br><span class="line">&#125;)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">使用：v-<span class="title class_">UpdataErroImage</span></span><br></pre></td></tr></table></figure>

<h3 id="注册全局组件"><a href="#注册全局组件" class="headerlink" title="注册全局组件"></a>注册全局组件</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">import ImageUpload from <span class="string">&#x27;./imageUpload&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">export</span> default &#123;</span><br><span class="line">  install(Vue) &#123;</span><br><span class="line">    //  注册全局的通用栏组件对象</span><br><span class="line">    //ImageUpload.name</span><br><span class="line">    Vue.component(<span class="string">&#x27;ImageUpload&#x27;</span>, ImageUpload)</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">main里全局注册</span><br><span class="line"></span><br><span class="line">import Plugin from &#x27;@/components/index&#x27;</span><br><span class="line">Vue.use(Plugin)</span><br></pre></td></tr></table></figure>

<h3 id="获取所有组件属性"><a href="#获取所有组件属性" class="headerlink" title="获取所有组件属性"></a>获取所有组件属性</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$attrs</span><br></pre></td></tr></table></figure>

<h3 id="删除判断-element"><a href="#删除判断-element" class="headerlink" title="删除判断(element)"></a>删除判断(element)</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">this</span>.$confirm(<span class="string">&#x27;此操作将永久删除该文件, 是否继续?&#x27;</span>, <span class="string">&#x27;提示&#x27;</span>, &#123;</span><br><span class="line">          <span class="attr">confirmButtonText</span>: <span class="string">&#x27;确定&#x27;</span>,</span><br><span class="line">          <span class="attr">cancelButtonText</span>: <span class="string">&#x27;取消&#x27;</span>,</span><br><span class="line">          <span class="attr">type</span>: <span class="string">&#x27;warning&#x27;</span></span><br><span class="line">        &#125;).<span class="title function_">then</span>(<span class="function">() =&gt;</span> &#123;</span><br><span class="line">          <span class="variable language_">this</span>.$message(&#123;</span><br><span class="line">            <span class="attr">type</span>: <span class="string">&#x27;success&#x27;</span>,</span><br><span class="line">            <span class="attr">message</span>: <span class="string">&#x27;删除成功!&#x27;</span></span><br><span class="line">          &#125;);</span><br><span class="line">        &#125;).<span class="title function_">catch</span>(<span class="function">() =&gt;</span> &#123;</span><br><span class="line">          <span class="variable language_">this</span>.$message(&#123;</span><br><span class="line">            <span class="attr">type</span>: <span class="string">&#x27;info&#x27;</span>,</span><br><span class="line">            <span class="attr">message</span>: <span class="string">&#x27;已取消删除&#x27;</span></span><br><span class="line">          &#125;);          </span><br><span class="line">        &#125;);</span><br></pre></td></tr></table></figure>

<h3 id="过滤器"><a href="#过滤器" class="headerlink" title="过滤器"></a>过滤器</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> * <span class="keyword">as</span> filters <span class="keyword">from</span> <span class="string">&#x27;./filters&#x27;</span> <span class="comment">// global filters</span></span><br><span class="line"><span class="comment">// 过滤器(main.js)</span></span><br><span class="line"><span class="title class_">Object</span>.<span class="title function_">keys</span>(filters).<span class="title function_">forEach</span>(<span class="function"><span class="params">key</span> =&gt;</span> &#123;</span><br><span class="line">  <span class="title class_">Vue</span>.<span class="title function_">filter</span>(key, filters[key])</span><br><span class="line">&#125;)</span><br><span class="line"></span><br><span class="line"><span class="comment">//应用</span></span><br><span class="line">&lt;template #<span class="keyword">default</span>=<span class="string">&quot;&#123;row&#125;&quot;</span>&gt;&#123;&#123; row.<span class="property">create_date</span> | parseTimeByString&#125;&#125;&lt;/template&gt;</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>



<h3 id="枚举"><a href="#枚举" class="headerlink" title="枚举"></a>枚举</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"> &lt;el-table-column :formatter=&quot;formatEmployment&quot; label=&quot;聘用形式&quot; prop=&quot;formOfEmployment&quot; sortable /&gt;</span><br><span class="line"></span><br><span class="line">//属性</span><br><span class="line">  hireType: EmployeeEnum.hireType,</span><br></pre></td></tr></table></figure>

<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//方法</span></span><br><span class="line"><span class="title function_">formatEmployment</span>(<span class="params">row</span>) &#123;</span><br><span class="line">      <span class="keyword">const</span> obj = <span class="variable language_">this</span>.<span class="property">hireType</span>.<span class="title function_">find</span>(<span class="function">(<span class="params">item</span>) =&gt;</span> item.<span class="property">id</span> === <span class="title class_">Number</span>(row.<span class="property">formOfEmployment</span>))</span><br><span class="line">      <span class="keyword">return</span> obj?.<span class="property">value</span> ? obj?.<span class="property">value</span> : <span class="string">&#x27;未知&#x27;</span></span><br><span class="line">    &#125;,</span><br></pre></td></tr></table></figure>

<h3 id="删除"><a href="#删除" class="headerlink" title="删除"></a>删除</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 删除</span></span><br><span class="line">   <span class="keyword">async</span>  removeUser (id) &#123;</span><br><span class="line">     <span class="keyword">await</span> <span class="variable language_">this</span>.$confirm(<span class="string">&#x27;此操作将永久删除该文件, 是否继续?&#x27;</span>, <span class="string">&#x27;提示&#x27;</span>, &#123;</span><br><span class="line">       <span class="attr">confirmButtonText</span>: <span class="string">&#x27;确定&#x27;</span>,</span><br><span class="line">       <span class="attr">cancelButtonText</span>: <span class="string">&#x27;取消&#x27;</span>,</span><br><span class="line">       <span class="attr">type</span>: <span class="string">&#x27;warning&#x27;</span></span><br><span class="line">     &#125;)</span><br><span class="line">       .<span class="title function_">then</span>(<span class="keyword">async</span> () =&gt; &#123;</span><br><span class="line">         <span class="keyword">await</span> <span class="title function_">remove</span>(&#123; <span class="attr">id</span>: id &#125;)</span><br><span class="line">         <span class="variable language_">this</span>.<span class="title function_">getList</span>()</span><br><span class="line">         <span class="variable language_">this</span>.$message(&#123;</span><br><span class="line">           <span class="attr">type</span>: <span class="string">&#x27;success&#x27;</span>,</span><br><span class="line">           <span class="attr">message</span>: <span class="string">&#x27;删除成功!&#x27;</span></span><br><span class="line">         &#125;)</span><br><span class="line">       &#125;)</span><br><span class="line">       .<span class="title function_">catch</span>(<span class="function">() =&gt;</span> &#123;</span><br><span class="line">         <span class="variable language_">this</span>.$message(&#123;</span><br><span class="line">           <span class="attr">type</span>: <span class="string">&#x27;info&#x27;</span>,</span><br><span class="line">           <span class="attr">message</span>: <span class="string">&#x27;已取消删除&#x27;</span></span><br><span class="line">         &#125;)</span><br><span class="line">       &#125;)</span><br><span class="line">   &#125;,</span><br></pre></td></tr></table></figure>

    </div>
    
    
    
    
    
    
    
</div>

                <footer id="footer">
    <div id="footer-wrap">
        <div>
            &copy;
            2022 - 2023 Hexo
            <span id="footer-icon">
                <i class="fa-solid fa-font-awesome fa-fw"></i>
            </span>
            &commat;John Doe
        </div>
        <div>
            Based on the <a target="_blank" rel="noopener" href="https://hexo.io">Hexo Engine</a> &amp;
            <a target="_blank" rel="noopener" href="https://github.com/argvchs/hexo-theme-particlex">ParticleX Theme</a>
        </div>
        
    </div>
</footer>

            </div>
            </transition>
            
            <transition name="fade">
            <div id="preview" ref="preview" v-show="previewShow">
                <img id="preview-content" ref="previewContent" />
            </div>
            </transition>
            
        </div>
        <script src="/js/main.js"></script>
        
        




        
    </body>
</html>
